package com.ruoyi.pims.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pims.mapper.EduCourseMapper;
import com.ruoyi.pims.domain.EduCourse;
import com.ruoyi.pims.service.IEduCourseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 课程信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
@Service
public class EduCourseServiceImpl implements IEduCourseService 
{
    @Autowired
    private EduCourseMapper eduCourseMapper;

    /**
     * 查询课程信息
     * 
     * @param courseId 课程信息主键
     * @return 课程信息
     */
    @Override
    public EduCourse selectEduCourseByCourseId(Long courseId)
    {
        return eduCourseMapper.selectEduCourseByCourseId(courseId);
    }

    /**
     * 查询课程信息列表
     * 
     * @param eduCourse 课程信息
     * @return 课程信息
     */
    @Override
    public List<EduCourse> selectEduCourseList(EduCourse eduCourse)
    {
        return eduCourseMapper.selectEduCourseList(eduCourse);
    }

    /**
     * 新增课程信息
     * 
     * @param eduCourse 课程信息
     * @return 结果
     */
    @Override
    public int insertEduCourse(EduCourse eduCourse)
    {
        eduCourse.setCreateTime(DateUtils.getNowDate());
        return eduCourseMapper.insertEduCourse(eduCourse);
    }

    /**
     * 修改课程信息
     * 
     * @param eduCourse 课程信息
     * @return 结果
     */
    @Override
    public int updateEduCourse(EduCourse eduCourse)
    {
        eduCourse.setUpdateTime(DateUtils.getNowDate());
        return eduCourseMapper.updateEduCourse(eduCourse);
    }

    /**
     * 批量删除课程信息
     * 
     * @param courseIds 需要删除的课程信息主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseByCourseIds(String courseIds)
    {
        return eduCourseMapper.deleteEduCourseByCourseIds(Convert.toStrArray(courseIds));
    }

    /**
     * 删除课程信息信息
     * 
     * @param courseId 课程信息主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseByCourseId(Long courseId)
    {
        return eduCourseMapper.deleteEduCourseByCourseId(courseId);
    }
}
